#define _CRT_SECURE_NO_WARNINGS 1

#include"Heap.h"

void Test1()
{
	int* a[] = { 3,6,1,4,8,9,2,44,632,23,74,623,75,88,23,64,42,99 };
	HP heap;
	HPInit(&heap);
	int i = 0;
	int sz = sizeof(a) / sizeof(a[0]);
	while (i < sz)
	{
		HPPush(&heap, a[i]);
		i++;
	}
	int k = 0;
	scanf("%d", &k);
	while (k--)
	{
		int num = HPTop(&heap);
		printf("%d ", num);
		HPPop(&heap);
	}
}

void Test2()
{
	HPDataType a[] = { 3,6,1,4,8,9,2,44,632,23,74,623,75,88,23,64,42,99 };
	HP heap;
	HPInit(&heap);
	int i = 1;
	int sz = sizeof(a) / sizeof(a[0]);
	while (i < sz)
	{
		AdjustUp(a, i);
		i++;
	}
	for (int end = sz - 1; end; end--)
	{
		Swap(&a[0], &a[end]);
		AdjustDown(a, end, 0);
	}
}

int main()
{
	Test2();
	return 0;
}